<?php
/**
 * Class descript.
 * User: chan
 * Date: 2017/10/20 11:22
 */
namespace app\api\validate;
class System extends BaseValidate
{
    public function checkCategoryEdit()
    {
         $this->rule = [
             'name' => 'require|isNotEmpty',
            'des' => 'require|isNotEmpty',
        ];
         $this->message = [
             'name.require' => '分类名字必传',
            'des.require' => '分类描述必传',
        ];
    }
    public function checkCategoryDel()
    {
        $this->rule = [
            'id' => 'require|isNotEmpty',
        ];
        $this->message = [
            'id.require' => 'ID必传',
        ];
    }
    public function checkGoodsEdit()
    {
        $this->rule = [
            'name' => 'require|isNotEmpty',
           // 'des' => 'require|isNotEmpty',
            //'label' => 'require|isNotEmpty',
            'cid' => 'require|isNotEmpty',
            'price' => 'require|isNotEmpty',
            'oldprice' => 'require|isNotEmpty',
            'stock' => 'require|isNotEmpty',
            //'unit' => 'require|isNotEmpty',
        ];
        $this->message = [
            'name' => '商品名字必填',
            //'label' => '标签必选',
            'cid' => '分类必选',
            'price' => '价格必填',
            'oldprice' => '原价必填',
            'stock' => '库存必填',
        ];
    }

    public function checkOptionEdit()
    {
        $this->rule = [
            'spec_name' => 'require|isNotEmpty',
            'spec_stock' => 'require|isNotEmpty',
            'spec_price' => 'require|isNotEmpty',
        ];
        $this->message = [
            'spec_name' => '规格名称必填',
            'spec_stock' => '规格库存必填',
            'spec_price' => '规格价格必填',
        ];
    }
    public function checkPramEdit()
    {
        $this->rule = [
            'param_name' => 'require|isNotEmpty',
            'param_option' => 'require|isNotEmpty',
        ];
        $this->message = [
            'param_name' => '属性名称必填',
            'param_option' => '属性选项必传',
        ];
    }
    public function setPassword()
    {
        $this->rule = [
            'code' => 'require|isNotEmpty',
            'password' => 'require|isNotEmpty',
            'repassword' => 'require|isNotEmpty',
        ];
        $this->message = [
            'code' => '手机验证码不能为空',
            'password' => '密码不能为空',
            'repassword' => '确认密码不能为空',
        ];
    }
    public function Bind()
    {
        $this->rule = [
            'code' => 'require|isNotEmpty',
            'mobile' => 'require|isNotEmpty',
        ];
        $this->message = [
            'code' => '手机验证码不能为空',
            'mobile' => '密码不能为空',
        ];
    }
    public function auth()
    {
        $this->rule = [
            'shopname' => 'require|isNotEmpty',
            'license_term' => 'require|isNotEmpty',
            'food_term' => 'require|isNotEmpty',
            'license_name' => 'require|isNotEmpty',
            'food_name' => 'require|isNotEmpty',
        ];
        $this->message = [
            'shopname' => '执照企业名不能为空',
            'license_term' => '营业执照有效期不能为空',
            'food_term' => '食品安全证书有效期不能为空',
            'license_name' =>'营业执照法人不能为空',
            'food_name' =>  '食品安全证书法人不能为空',
        ];
    }
    public function reply()
    {
        $this->rule = [
            'id' => 'require|isNotEmpty',
            'content' => 'require|isNotEmpty',
        ];
        $this->message = [
            'id' => 'ID不能为空',
            'content' => '回复内容不能为空',
        ];
    }
    public function basic()
    {
        $this->rule = [
            'shopname' => 'require|isNotEmpty',
            'cid' => 'require|isNotEmpty',
        ];
        $this->message = [
            'shopname' => '店铺名字不能为空',
            'cid' => '请选择分类',
        ];
    }
    public function address()
    {
        $this->rule = [
            'province' => 'require|isNotEmpty',
            'city' => 'require|isNotEmpty',
            'county' => 'require|isNotEmpty',
            'street' => 'require|isNotEmpty',
            'address' => 'require|isNotEmpty',
        ];
        $this->message = [
            'province' => '省份不能为空',
            'city' => '城市不能为空',
            'county' => '县/区不能为空',
            'street' => '街道/镇不能为空',
            'address' => '详细地址不能为空',
        ];
    }
    public function bindcard()
    {
        $this->rule = [
            'name' => 'require|isNotEmpty',
            'card_num' => 'require|isNotEmpty',
            'bank' => 'require|isNotEmpty',
            'mobile' => 'require|isNotEmpty',
            'code' => 'require|isNotEmpty',
        ];
        $this->message = [
            'name' => '持卡人不能为空',
            'card_num' => '银行卡号不能为空',
            'bank' => '所属银行不能为空',
            'mobile' => '手机号不能为空',
            'code' => '验证码不能为空',
        ];
    }
    public function apply()
    {
        $this->rule = [
            'money' => 'require|isNotEmpty',
        ];
        $this->message = [
            'money.require' => '提现金额必传',
        ];
    }
}